package cn.sirun.com.fca.account.model.base;

import com.tencent.cloud.iov.util.ObjectUtils;

import cn.sirun.com.fca.account.model.bind.SubmitCarInfoRequest;
import cn.sirun.com.fca.account.model.profile.Reseller;

/**
 * @author vinsonhuang
 * @date 2018/8/14
 */
public class CarData extends SubmitCarInfoRequest {

    private int active;

    private long updateTime;

    private String carType;

    private String carTypeUrl;

    private String plateNumber;

    private LastAuthorizedInfo lastAuthorizedInfo;

    private Reseller reseller;

    public CarData() {
    }

    public CarData(String url, String carNumber, String engineId, String owner, int active,
                   long updateTime, String carType, String carTypeUrl, String plateNumber,
                   LastAuthorizedInfo lastAuthorizedInfo, Reseller reseller) {
        super(url, carNumber, engineId, owner);
        this.active = active;
        this.updateTime = updateTime;
        this.carType = carType;
        this.carTypeUrl = carTypeUrl;
        this.plateNumber = plateNumber;
        this.lastAuthorizedInfo = lastAuthorizedInfo;
        this.reseller = reseller;
    }

    public CarData(CarData carData) {
        this.active = carData.active;
        this.updateTime = carData.updateTime;
        this.carType = carData.carType;
        this.carTypeUrl = carData.carTypeUrl;
        this.plateNumber = carData.plateNumber;
        this.lastAuthorizedInfo = carData.lastAuthorizedInfo;
        this.url = carData.url;
        this.carNumber = carData.carNumber;
        this.engineId = carData.engineId;
        this.owner = carData.owner;
        this.reseller = carData.reseller;
    }

    public int getActive() {
        return active;
    }

    public void setActive(int active) {
        this.active = active;
    }

    public long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(long updateTime) {
        this.updateTime = updateTime;
    }

    public String getCarType() {
        return carType;
    }

    public void setCarType(String carType) {
        this.carType = carType;
    }

    public String getCarTypeUrl() {
        return carTypeUrl;
    }

    public void setCarTypeUrl(String carTypeUrl) {
        this.carTypeUrl = carTypeUrl;
    }

    public String getPlateNumber() {
        return plateNumber;
    }

    public void setPlateNumber(String plateNumber) {
        this.plateNumber = plateNumber;
    }

    public LastAuthorizedInfo getLastAuthorizedInfo() {
        return lastAuthorizedInfo;
    }

    public void setLastAuthorizedInfo(LastAuthorizedInfo lastAuthorizedInfo) {
        this.lastAuthorizedInfo = lastAuthorizedInfo;
    }

    public Reseller getReseller() {
        return reseller;
    }

    public void setReseller(Reseller reseller) {
        this.reseller = reseller;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CarData carData = (CarData) o;
        return active == carData.active &&
                updateTime == carData.updateTime &&
                ObjectUtils.equals(carType, carData.carType) &&
                ObjectUtils.equals(carTypeUrl, carData.carTypeUrl) &&
                ObjectUtils.equals(plateNumber, carData.plateNumber) &&
                ObjectUtils.equals(lastAuthorizedInfo, carData.lastAuthorizedInfo) &&
                ObjectUtils.equals(reseller, carData.reseller);
    }

    @Override
    public int hashCode() {
        return ObjectUtils.hash(active, updateTime, carType, carTypeUrl, plateNumber,
                lastAuthorizedInfo, reseller);
    }

    @Override
    public String toString() {
        return "CarData{" +
                "active=" + active +
                ", updateTime=" + updateTime +
                ", carType='" + carType + '\'' +
                ", carTypeUrl='" + carTypeUrl + '\'' +
                ", plateNumber='" + plateNumber + '\'' +
                ", lastAuthorizedInfo=" + lastAuthorizedInfo +
                ", reseller=" + reseller +
                '}';
    }
}
